//
//  ZCBHomeVerticalButton1.m
//  ZhaoCaiHuiBaoRt
//
//  Created by apple on 2017/4/26.
//  Copyright © 2017年 ttayaa. All rights reserved.
//

#import "ZCBHomeVerticalButton1.h"

@implementation ZCBHomeVerticalButton1

- (void)setup
{
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    
    self.imageView.TTcenterX = self.TTcenterX;
    
//    
//    //    375/16
//    CGFloat scanFont =hScreenWidth * 16/375;
//    self.titleLabel.font = [UIFont systemFontOfSize:scanFont];
    
}

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self setup];
    }
    return self;
}

- (void)awakeFromNib
{
    [super awakeFromNib];
    
    [self setup];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    // 调整图片
    self.imageView.TTx = 0;
    self.imageView.TTy = 20;
    self.imageView.TTwidth = self.TTwidth*0.4;
    self.imageView.TTheight = self.imageView.TTwidth;
    
    
    // 调整文字
    self.titleLabel.TTx = 0;
    self.titleLabel.TTy = self.imageView.TTheight+10;
    self.titleLabel.TTwidth = self.TTwidth;
    self.titleLabel.TTheight = self.TTheight - self.titleLabel.TTy;
    
    self.imageView.TTcenterX = self.titleLabel.TTcenterX;
    
}
@end
